package com.smartcanteen.user.mapper;

import com.smartcanteen.system.api.domain.SysDept;
import feign.Param;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface DeptMapper {
    @Select("select dept_name from sys_dept where dept_id = #{deptId}")
    public String getDeptName(@Param("deptId") Long deptId);

    // 根据部门ID查询上级部门id
    @Select("select parent_id from sys_dept where dept_id = #{deptId}")
    public Long getParentId(@Param("deptId") Long deptId);


    @Select("select * from sys_dept where parent_id = #{parentId}")
    List<SysDept> getDept(@Param("parentId") Long parentId);
}
